Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display actual addresses on participant page #37

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

ChisomOkwor
Copy link
Contributor

This PR displays the actual participants addresses.
It's a draft, as I'm awaiting #35 Ved's merge.

  1. If the user manually inputs their address, it's stored in data-store and displayed on the participant page.
  2. If the user chooses to use the HTML Geo-location, the reverse Geo-coding API converts the coordinate to an actual address, which is also stored in datastore and displayed on the participant page.

src/server.js Show resolved Hide resolved
@ChisomOkwor ChisomOkwor marked this pull request as ready for review August 4, 2020 01:37
@@ -368,7 +376,37 @@ function encodeAddress(address) {
return formattedAddress;
}

// This number should be kept in sync with the port number in nodemon.json
app.get(`${PREFIX_API}/reverseGeocode`, async (request, response) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something that hadn't occurred to me earlier - are you essentially allowing anyone to make free geocode requests and spend your money? could i just point my own external code at this endpoint to make geocode requests with your API key, or is this somehow blocked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure, but I think there's a possibility that could happen. But either way it's done, the geo-coded location always shows up on the participant page. A hacker could still access it there? I'm wondering because I thought this works the same way the place search works. Or is this different because the goecoded address is in the JS frontend?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the difference is between a malicious user being able to geocode only address that the user has entered vs being able to geocode any arbitrary address. ideally this should be designed such that it's only possible to geocode addresses that are being entered into the db - ie a hacker would have to actually be using your app, and you could easily apply rate limiting, etc.

@ChisomOkwor ChisomOkwor requested review from skzv and vedantroy August 4, 2020 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants